package Controleur;

import Reseau.Noeud;

public class Vehicule {
	private int vitesse = 1;
	private Noeud noeudActuel;
	private Noeud noeudDest;
	private Urgence urgenceActuelle;
	private Noeud noeudAttache;
	private int tempsTraitement = 0;
	
	public Vehicule(Noeud noeudAttache){
		this.noeudAttache = noeudAttache;
		reset();
	}
	
	public Noeud getNoeudActuel(){
		return noeudActuel;
	}
	
	public Noeud getNoeudParcours(){
		if(noeudDest != null)
			return noeudDest;
		else return noeudActuel;
	}
	
	public Noeud getNoeudDest(){
		return noeudDest;
	}
	
	public Noeud getNoeudAttache(){
		return noeudAttache;
	}
	
	public void setNoeudAttache(Noeud noeud){
		noeudAttache = noeud;
	}
	
	public Urgence getUrgenceActuelle(){
		return urgenceActuelle;
	}
	
	public void deplacer(Noeud noeudDest){
		if(this.noeudDest != null)
			this.noeudActuel = this.noeudDest;
		this.noeudDest = noeudDest;
		tempsTraitement = 0;
	}
	
	public int getTempsTraitement(){
		return tempsTraitement;
	}
	
	public void setVitesse(int vitesse){
		this.vitesse = vitesse;
	}
	
	public void incremente(){
		tempsTraitement += vitesse;
	}
	
	public void reset(){
		noeudActuel = noeudAttache;
		noeudDest = null;
		tempsTraitement = 0;
	}
}
